<?php

/**
 * Description of CAB_Form_Element_numberSS
 *
 * @author GILLES
 */
class Cab_Form_Element_numberSS extends Zend_Form_Element_Xhtml {

    public $helper = "numberElement";
    protected $num = null;

    public function init() {
        $view = $this->getView();
        $view->addHelperPath('Cab/view/helper/', 'Cab_View_Helper');
    }

    public function isValid($value, $context = null) {

        if (is_array($value)) {
            $value = $value['num'] . $value['cle'];
            $this->setValue($value);
        }
        return parent::isValid($value, $context);
    }

    public function setValue($value) {
        $this->num = $value;
        return $this;
    }

    public function _getValue() {
        if (is_array($this->num)) {
            $value = $this->num['num'] . $this->num['cle'];
            $this->setValue($value);
        }

        return parent::getValue();
    }

    public function getValue() {
        return $this->num;
    }

}

